/*
 * @Author: yushuang
 * @Date: 2024-12-03 15:58:14
 * @LastEditors: yushuang
 * @LastEditTime: 2024-12-19 11:20:38
 * @Description:
 */
import { createPinia } from 'pinia';
import { createApp } from 'vue';
import type { App } from 'vue';
import Root from './App.vue';
import router from '@/router';
import '@/router/router-guard';
import 'ant-design-vue/dist/reset.css';
import '@/assets/styles/index.less';
import { setupAccessDirective, setupLoadingDirective } from '@/directive';

const pinia = createPinia();

async function start() {
  const app: App = createApp(Root);
  app.use(pinia);
  setupDirective(app);
  app.use(router);
  app.mount('#app');
  app.config.performance = true;
}
start();

function setupDirective(app: App) {
  // 注册loading自定义指令
  setupLoadingDirective(app);
  setupAccessDirective(app);
}
